#define _CRT_SECURE_NO_WARNINGS 1

#include<stdio.h>
int Multi(int n)
{
	int multi = 1;
	for (int i = 1; i <= n; i++)
	{
		multi *= i;
	}
	return multi;
}

int main()
{
	int n = 0;
	scanf("%d", &n);
	int sum = 0;
	for (int i = 1; i <= n; i++)
	{
		sum += Multi(i);
	}
	printf("%d", sum);
	return 0;

}